package main

import (
	"github.com/robfig/cron"
	"log"
)

/*
参考：https://juejin.cn/post/6917489009140695053
*/

func main() {
	i := 0
	c := cron.New()
	spec := "0/1 * * * * *"
	c.AddFunc(spec, func() {
		i++
		log.Println("execute per 1 seconds", i)
	})
	c.Start()
	select {}
}
